import { useAccess, history } from '@umijs/max'

const usePageAccess = (): Record<string, boolean> => {
  const access = useAccess()

  return access[`${history.location.pathname}-element`] || {}
}

export default usePageAccess
